

package org.smallbun.fast.manage.activity.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.smallbun.fast.manage.activity.dao.ActivityMapper;
import org.smallbun.fast.manage.activity.dao.UserMapper;
import org.smallbun.fast.manage.activity.entity.ActivityEntity;
import org.smallbun.fast.manage.activity.entity.UserEntity;
import org.smallbun.fast.manage.activity.service.ActivityService;
import org.smallbun.fast.manage.activity.service.UserService;
import org.smallbun.framework.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;


/**
 * @author lovec
 */
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class, readOnly = true)
public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserEntity> implements UserService {

	private final UserMapper userMapper;

	public UserServiceImpl(UserMapper userMapper) {
		this.userMapper = userMapper;
	}

	@Override
	public UserEntity getUserByOpenId(String id) {
		return userMapper.selectOne(new QueryWrapper<>(UserEntity.builder().openId(id).build()));
	}
}
